package homework.oopDay03;

public class ReArrayDemo {
    public static void main(String[] args) {
        Dog[] dogs = new Dog[2];
        dogs[0] = new Dog("小黑",1,"黑");
        dogs[1] = new Dog("小白",2,"白");
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].lookHome();
            dogs[i].swim();
            dogs[i].eat();
        }
        Chick[] chicks = new Chick[2];
        chicks[0] =new Chick("🐤",1,"黄");
        chicks[1] =new Chick("小花",2,"花");
        for (int i = 0; i < chicks.length; i++) {
            System.out.println(chicks[i].name);
            chicks[i].eat();
            chicks[i].layEgg();
        }
        Fish[] fish = new Fish[2];
        fish[0] =new Fish("小粉",1,"粉");
        fish[1] =new Fish("小金",2,"金");
        for (int i = 0; i < fish.length; i++) {
            System.out.println(fish[i].name);
            fish[i].swim();
            fish[i].eat();
        }
    }
}
